/*
 * @Author: 陈永浩(cyh1231wp@163.com)
 * @Date: 2020-11-02 23:24:58
 * @LastEditors: 陈永浩(cyh1231wp@163.com)
 * @LastEditTime: 2020-12-18 15:02:27
 */
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
const files = require.context('./modules', false, /\.js$/)
const modules = {}

files.keys().forEach((key) => {
  modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default
})
Object.keys(modules).forEach((key) => {
  modules[key]['namespaced'] = true
})
const store = new Vuex.Store({
  modules,
})
export default store
